package com.eqxiu.ieditor.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;
import java.util.Map;

/**
 * @author suixiangyu
 */
@JsonInclude(value = Include.NON_NULL)
public class CriteriaDTO {

    private Integer category;

    private Integer subcat;

    private String keywords;

    private String priceRange;
    private String sortBy;
    private String direct;
    @JsonProperty(required = true)
    private int pageNo = 1;
    @JsonProperty(required = true)
    private int pageSize = 50;
    /**
     * 供应商ID
     */
    private Integer brandId;
    /**
     * 折扣标识
     */
    private Integer cutPriceFlag;
    /**
     * 来源类型
     */
    private Integer sourceType;
    /**
     * 会员特价标识
     */
    private Integer sourceTypeSpecial;

    private List<Integer> type;

    private List<String> ppPath;

    private String sevenReferCount;

    private String monthReferCount;

    private String color;

    /**
     * 是否有折扣1：是 0：不是
     */
    private Integer discountPriceType;

    /**
     * 搜索位置ID
     */
    private String searchCode;
    /**
     * 属性/属性值筛选条件
     */
    private List<Map<String, Object>> attributeLists;

    /**
     * 平台
     */
    private String platform;
    /**
     *添加默认属性标识 true:添加默认属性
     **/
    private boolean defaultAttrFlag;

    public Integer getDiscountPriceType() {
        return discountPriceType;
    }

    public void setDiscountPriceType(Integer discountPriceType) {
        this.discountPriceType = discountPriceType;
    }

    public Integer getCategory() {
        return category;
    }

    public void setCategory(Integer category) {
        this.category = category;
    }

    public Integer getSourceTypeSpecial() {
        return sourceTypeSpecial;
    }

    public void setSourceTypeSpecial(Integer sourceTypeSpecial) {
        this.sourceTypeSpecial = sourceTypeSpecial;
    }

    public String getPriceRange() {
        return priceRange;
    }

    public void setPriceRange(String priceRange) {
        this.priceRange = priceRange;
    }

    public String getSortBy() {
        return sortBy;
    }

    public void setSortBy(String sortBy) {
        //        if (StringUtils.isBlank(sortBy)) {
        //            sortBy = "sort|desc";
        //        }
        this.sortBy = sortBy;
    }

    public String getDirect() {
        return direct;
    }

    public void setDirect(String direct) {
        this.direct = direct;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        if (pageSize > 100) {
            this.pageSize = 19;
        }
        this.pageSize = pageSize;
    }

    public List<Integer> getType() {
        return type;
    }

    public void setType(List<Integer> type) {
        if (type != null && type.size() > 0) {
            this.type = type;
        }
    }

    public Integer getBrandId() {
        return brandId;
    }

    public void setBrandId(Integer brandId) {
        this.brandId = brandId;
    }

    /**
     * @return the keywords
     */
    public String getKeywords() {
        return keywords;
    }

    /**
     * @param keywords the keywords to set
     */
    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public Integer getCutPriceFlag() {
        return cutPriceFlag;
    }

    public void setCutPriceFlag(Integer cutPriceFlag) {
        this.cutPriceFlag = cutPriceFlag;
    }

    public Integer getSourceType() {
        return sourceType;
    }

    public void setSourceType(Integer sourceType) {
        this.sourceType = sourceType;
    }

    public List<String> getPpPath() {
        return ppPath;
    }

    public void setPpPath(List<String> ppPath) {
        this.ppPath = ppPath;
    }

    /**
     * @return the sevenReferCount
     */
    public String getSevenReferCount() {
        return sevenReferCount;
    }

    /**
     * @param sevenReferCount the sevenReferCount to set
     */
    public void setSevenReferCount(String sevenReferCount) {
        this.sevenReferCount = sevenReferCount;
    }

    /**
     * @return the monthReferCount
     */
    public String getMonthReferCount() {
        return monthReferCount;
    }

    /**
     * @param monthReferCount the monthReferCount to set
     */
    public void setMonthReferCount(String monthReferCount) {
        this.monthReferCount = monthReferCount;
    }

    public String getSearchCode() {
        if (("").equals(searchCode) || null == searchCode) {
            searchCode = "99091";
        }
        return searchCode;
    }

    public void setSearchCode(String searchCode) {
        this.searchCode = searchCode;
    }

    public List<Map<String, Object>> getAttributeLists() {
        return attributeLists;
    }

    public void setAttributeLists(List<Map<String, Object>> attributeLists) {
        this.attributeLists = attributeLists;
    }

    public Integer getSubcat() {
        return subcat;
    }

    public void setSubcat(Integer subcat) {
        this.subcat = subcat;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }


    public String getPlatform() {
        return platform;
    }

    public void setPlatform(String platform) {
        this.platform = platform;
    }

    public boolean isDefaultAttrFlag() {
        return defaultAttrFlag;
    }

    public void setDefaultAttrFlag(boolean defaultAttrFlag) {
        this.defaultAttrFlag = defaultAttrFlag;
    }
}
